<?php
/**
 * Created by PhpStorm.
 * User: zhan
 * Date: 2018/9/12  15:46
 */
namespace app\api\service;
use app\api\BaseModel;
use think\Loader;
use Webimsdk\take\TimRestAPI;
class Yun
{
    #app基本信息
    protected $sdkappid =1400138386;
    protected $usersig = '';
    protected $identifier = 'admin1';
    protected $api;
    protected $private_key_path;
    protected $signature;
    public function __construct()
    {
        $this->sdkappid;
        $this->identifier;
        $this->private_key_path = config('yun.key');
        $this->signature = config('yun.signature');
        $this->api= new TimRestAPI();
    }

    /**
     * 获取云通信IM sig
     * @return string
     */
    public function userSig(){
        $sig = $this->api->generate_user_sig($this->identifier, '',$this->private_key_path, $this->signature);
        return $sig;
    }
}